package org.zjx;

import org.zjx.core.SocketConfig;
import org.zjx.server.ClusterServer;

public class Main {
    public static void main(String[] args) {
        new Thread(() -> {
            System.out.println("Worker services registered");

            SocketConfig workerConfig = new SocketConfig();
            workerConfig.setServerHost("localhost");
            workerConfig.setPort(8890);
            workerConfig.setDebugEnabled(true);
            workerConfig.setReconnectInterval(3000); // 3秒重试

            ClusterServer worker = new ClusterServer(workerConfig,
                    ClusterServer.ServerType.WORKER, "localhost", 8888);

//            worker.getServiceRegistry().registerService(AddService.class,new AddServiceImpl());
//            worker.getServiceRegistry().registerService(UpdatePlayerService.class,new UpdatePlayerServiceImpl());
            worker.start();

            System.out.println("Worker server started on port 8890");
        }).start();
    }
}
